#include<iostream>
#include<vector>
#include<string>
using namespace std;
class PHONEBOOK
{
	private:
		int m_ID;
		string m_name;
		string m_phone;
		string m_group;
	public:
		PHONEBOOK()
		{

		}
		PHONEBOOK(int id,char* name,char* phnoe,char* group)
		{
			m_ID=id;
			m_name=name;
			m_phone=phnoe;
			m_group=group;
		}
		void print()
		{
			cout<<m_ID<<'\t'<<m_name<<'\t'<<m_phone<<'\t'<<m_group<<endl;
		}
		bool operator == (PHONEBOOK &p)
		{
			if(p.m_ID==m_ID)
				return true;
			return false;
		}
};
int main()
{
    vector<PHONEBOOK>vec;
    PHONEBOOK pbook[4]={{20181208,"mary","130112","classmates"},
	{20181127,"tom","139346","family"},
	{20181156,"john","132456","classmates"},
	{20171124,"lisa","138456","classmates"}};
    for (int i = 0; i < 4; i++)
    {
        vec.push_back(pbook[i]);
    }
    cout<<"通信录内容列表："<<endl;
    for (int i = 0; i < 4; i++)
    {
        vec[i].print();
    }
    PHONEBOOK record(20181209,"pjouh","123654","classmates");
    vec.insert(vec.begin(),record);
    cout<<"通信录内容列表："<<endl;
    for (vector<PHONEBOOK>::iterator it=vec.begin(); it!=vec.end(); it++)
    {
        (*it).print();
    }
    cout<<"删除元素："<<endl;
   vec.erase(++(++vec.begin()))->print();
    cout<<"通信录内容列表："<<endl;
    for (vector<PHONEBOOK>::iterator it=vec.begin();it!=vec.end(); it++)
    {
        (*it).print();
    }
    cout<<endl;
}